package com.zpz.framework.zpzoauth.common.utils;

import com.github.pagehelper.PageInfo;
import org.springframework.beans.BeanUtils;

import java.util.List;

/**
 * @author zhangpanzhi
 * @time 2019-07-09
 * @description 未经本人允许请勿随便改动，尊重劳动
 * */
public class ZpzOauthPageInfoExt<T,V> extends PageInfo<T> {
    public  PageInfo<V> getPage(List<T> source,Class target){
        PageInfo<T> tPageInfo = new PageInfo<>(source);
        PageInfo<V> targetP=new PageInfo<V>();
        BeanUtils.copyProperties(tPageInfo,targetP,new String[]{"list"});
        List list = ZpzOauthListUtil.copyListProperties(source, target);
        targetP.setList(list);
        return targetP;
    }
}
